# Packages
import tkinter.messagebox
import tkinter.filedialog
from tkinter.ttk import *
from tkinter import *

# Self-defined modules
from utility import *



class GUI:

    def __init__(self):
        self.root = Tk()
        self.folder_path, self.form_type, self.prompt = StringVar(), StringVar(), StringVar()
        self.root.title(TITLE)
        self.root.geometry(WINDOW_SIZE)

    def confirm_form_type(self):
        pass

    def select_folder(self):
        folder_path = tkinter.filedialog.askdirectory()
        self.folder_path.set(folder_path)
        print(self.prompt.get())
        # traverse_files(folder_path)

    def process(self):
        folder_label = Label(self.root, text="报表文件夹:")
        folder_entry = Entry(self.root, textvariable=self.folder_path)

        form_type_label = Label(self.root, text="请输入报表类别:")
        form_type_entry = Entry(self.root, textvariable=self.form_type)

        form_type_button = Button(self.root, text="确定", command=self.select_folder)

        folder_label.place(x=1, y=1)
        folder_entry.place(x=100, y=1)


        # Entry(self.root, textvariable=self.prompt).grid(row=1, column=1)
        folder_button = Button(self.root, text="选择文件夹", command=self.select_folder)
        folder_button.place(x=3, y=130)
        self.root.mainloop()



if __name__ == '__main__':
   app = GUI()
   app.process()



